//
//  UIViewController+SuperVC.m
//  SmartEstateCC
//
//  Created by xieqilin on 2018/8/15.
//  Copyright © 2018年 pretang. All rights reserved.
//

#import "UIViewController+SuperVC.h"

@implementation UIViewController (SuperVC)

//获取控制器
+ (UIViewController *)viewController:(id)view {
    for (UIView* next = [view superview]; next; next = next.superview) {
        UIResponder *nextResponder = [next nextResponder];
        if ([nextResponder isKindOfClass:[UIViewController class]]) {
            return (UIViewController *)nextResponder;
        }
    }
    return nil;
}

@end
